qui(function(require, exports, module) {

    News.Config = {

		REPEAT_INFO : ["周一","周二","周三","周四","周五","周六","周日"], //播放日期
        REGION_LIST: ['cq', 'sh', 'bj'],
        REGION_CH_LIST: ['重庆', '上海', '北京'],
        NEWS_STATUS: ['等待开播', '正在拆条', '拆条完成'],
        IP_LINK_AREA: {},
        IP_LINK_CH_AREA: {},
        PageBean: null,

        queryValidator: {
            messages: {
                start_time: {
                    isValidTime: "节目开始时间格式错误，格式应为：12:00",
                },
                stop_time: {
                    isValidTime: "节目结束时间格式错误，格式应为：12:00"
                }
            },
            rules: {
                start_time: {
                    isValidTime: true,
                },
                stop_time: {
                    isValidTime: true
                }
            }
        },

        validator: {
            messages: {
                program_name: {
                    required: "新闻节目名称不能为空",
                },
                channel_name: {
                    required: '所属电视台不能为空',
                },
                start_time: {
                    required: '节目开始时间不能为空',
                    isValidTime: "节目开始时间格式错误，格式应为：12:00",
                },
                stop_time: {
                    required: '节目结束时间不能为空',
                    isValidTime: "节目结束时间格式错误，格式应为：12:00",
                },
                repeat_info: '请至少选择一个播放日期',
            },
            rules: {
                program_name: {
                    required: true,
                },
                channel_name: {
                    required: true,
                },
                start_time: {
                    required: true,
                    isValidTime: true,
                },
                stop_time: {
                    required: true,
                    isValidTime: true,
                },
                repeat_info: {
                    minlength: 1,
                },
            }
        },

			TABLE_COLMODEL_CONFIG: {
				'program_name': {
					name: 'program_name',
					title: false,
					index: 'program_name',
					align:'center',
					sortable: false,
					width: 140
				},
				'channel_name': {
                    name: 'channel_name',
                    title: false,
                    index: 'channel_name',
                    align:'center',
                    sortable: false,
                    width: 140
                },
                'channel_area': {
                    name: 'channel_area',
                    title: false,
                    index: 'channel_area',
                    align:'center',
                    sortable: false,
                    width: 140,
                    formatter: function(v, o, r) {
                        return News.Util.formatter.channelArea(v,r);
                    }
                },
                'channel_ip': {
                    name: 'channel_ip',
                    title: false,
                    index: 'channel_ip',
                    align:'center',
                    sortable: false,
                    width: 140
                },
				'repeat_info': {
					name: 'repeat_info',
					title: false,
					index: 'repeat_info',
					align:'center',
					width: 230,
					sortable: false,
					formatter: function(v, o, r) {
						return News.Util.formatter.repeatInfo(v,r);
					}
				},
				'start_time': {
					name: 'start_time',
					title: false,
					index: 'start_time',
					align:'center',
					sortable: false,
					width: 100,
					align: 'center',
                    formatter: function(v, o, r) {
                        return News.Util.formatter.startTime(v,r);
                    }
				},
				'stop_time': {
					name: 'stop_time',
					title: false,
					index: 'stop_time',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center',
					formatter: function(v, o, r) {
                        return News.Util.formatter.stopTime(v,r);
                    }
				},
				'status': {
					name: 'status',
					title: false,
					index: 'status',
					align:'center',
					sortable: false,
					width: 250,
					formatter: function(v, o, r) {
						return News.Util.formatter.status(v,r);
					}
				},
				'operate': {
					name: 'operate',
					title: false,
					index: 'operate',
					width: 140,
					align:'center',
					sortable: false,
					formatter: function(v, o, r) {
						return News.Util.formatter.operate(v,r);
					}

				},
				'statistics_show': {
				    name: 'statistic_show',
				    title: false,
				    index: 'statistics',
				    width: '100',
				    align: 'center',
				    sortable: false,
				    formatter: function(v, o, r) {
				        return News.Util.formatter.statisticsShow(v,r);
				    }
				}

			},

			TABLE: {
			    localReader: {
                    id: "program_id",
                    root: "rows",
                    page: "page",
                    total: "total",
                    records: "records"
                },
			    url: News.urlConfig.newsUrl,
			    datatype: "local",
			    loadtext: '加载中...',
                loadui: "block",
                mtype: "get",
                rowNum: 10,
                pager: "#NewsListPager",
                multiselect: false,
                onPaging: function(pgButton) {
                    var retValue = null;
                    retValue = News.Util.pageBeanPageHandler("NewsListGrid", "NewsListPager" , News.Config.PageBean ,pgButton);
                    if (retValue != null) {
                        $("#NewsListGrid")[0].addJSONData(retValue);
                    }
                    return "stop";
                },
				//colNames: ["新闻节目名称", "所属电视台", "服务器", "服务器IP", "播出日期", "起始时间", "结束时间", "当前状态", "操作","准确率查询"],
				colNames: ["新闻节目名称", "所属电视台", "服务器", "服务器IP", "播出日期", "起始时间", "结束时间", "当前状态","操作"],
				//colModel: ['program_name', 'channel_name', 'channel_area', 'channel_ip', 'repeat_info', 'start_time', 'stop_time', 'status', 'operate', 'statistics_show']
				colModel: ['program_name', 'channel_name', 'channel_area', 'channel_ip', 'repeat_info', 'start_time', 'stop_time', 'status', 'operate']
			}
		};
});